package com.team5.stockservice.service.impl;

import com.team5.stockservice.entity.Inport;
import com.team5.stockservice.entity.Provider;
import com.team5.stockservice.mapper.ProviderMapper;
import com.team5.stockservice.service.InportService;
import com.team5.stockservice.service.ProviderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class ProviderServiceImpl implements ProviderService {

    @Autowired
    private ProviderMapper providerMapper;

    @Override
    public List<Provider> select(String providername, String connectionperson, String phone, Integer index, Integer limit) {
        return providerMapper.select(providername, connectionperson, phone, index, limit);
    }

    @Override
    public void insert(String providername, String zip, String address, String telephone, String connectionperson, String phone, String bank, String account, String email, String fax, Integer available) {
        providerMapper.insert(providername, zip, address, telephone, connectionperson, phone, bank, account, email, fax, available);
    }

    @Override
    public void update(Integer id, String providername, String zip, String address, String telephone, String connectionperson, String phone, String bank, String account, String email, String fax, Integer available) {
        providerMapper.update(id, providername, zip, address, telephone, connectionperson, phone, bank, account, email, fax, available);
    }

    @Override
    public void delete(Integer id) {
        providerMapper.delete(id);
    }

    @Override
    public List<Provider> selectAvailable() {
        return providerMapper.selectAvailable();
    }
}
